import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: () => import('@/layouts/BasicLayout.vue'),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('@/views/home/index.vue')
      },
      {
        path: 'editor/:id?',
        name: 'editor',
        component: () => import('@/views/editor/index.vue')
      },
      {
        path: 'preview/:id',
        name: 'preview',
        component: () => import('@/views/preview/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 